package com.second.app.designpattern.adaptor;

/**
 * @Author GYZ
 * @Date 2023/11/9
 * <pre>
 *  类适配器 基于组合实现
 * </pre>
 */
public class AdaptorBaseComposition implements ITarget {

    private Adaptee adaptee;

    public AdaptorBaseComposition(Adaptee adaptee) {
        this.adaptee = adaptee;
    }

    @Override
    public void f1() {
        //委托给adaptee
        adaptee.fa();
    }

    @Override
    public void f2() {
        //重新实现
    }

    @Override
    public void f3() {
        //委托给adaptee
        adaptee.fc();
    }
}
